package UseCollection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class IterateCollection {
    public static void main(String[] args) {
        method01Iterator();
    }

    public static void method01Iterator() {
        Collection<String> coll = new ArrayList<>();
        coll.add("pose");
        coll.add("transpose");
        coll.add("position");
        coll.add("apposition");
        coll.add("preposition");
        coll.add("positive");
        coll.add("negative");
        Iterator<String> iterator = coll.iterator();
        while (iterator.hasNext()){
            String str = iterator.next();
            System.out.println(str);
        }


    }
}
